package com.gitee.sop.layui.adminserver.module.background.admin.rest;


import com.gitee.sop.layui.adminserver.module.background.admin.dto.SysDataModifyLockDTO;
import com.gitee.sop.layui.adminserver.module.background.admin.service.SysDataModifyLockService;
import com.gitee.sop.layui.adminserver.module.base.bo.ValidGroup;
import com.gitee.sop.layui.adminserver.module.base.constants.Result;
import org.springframework.context.annotation.Lazy;
import org.springframework.http.MediaType;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * com.zch.admin.base.entity.SysDataModifyLock模型http接口处理
 *
 * @author: admin
 * @date: 2019-12-02
 * @version: 1.0.0
 */
@Validated(value = {ValidGroup.All.class})
@RestController
@RequestMapping(value = "/admin/dataModifyLock", produces = {MediaType.APPLICATION_JSON_UTF8_VALUE})
public class SysDataModifyLockRestController {

    @Lazy
    @Resource
    private SysDataModifyLockService baseService;

    @PostMapping(value = {"/add"})
    public Result add(SysDataModifyLockDTO query) {
        baseService.add(query);
        return Result.success();
    }

    @PostMapping(value = {"/delete"})
    public Result deleteById(SysDataModifyLockDTO query) {
        baseService.removeByKey(query);
        return Result.success();
    }

}
